<template>
    <div>
        <h2>医生详情</h2>
        <table class="table">
            <tbody>
                <tr>
                    <td>医生</td>
                    <td>
                        <span>{{ data.name }}</span>
                    </td>
                </tr>
                <tr>
                    <td>科室</td>
                    <td>
                        <span>{{ data.kname }}</span>
                    </td>
                </tr>
                <tr>
                    <td>职称</td>
                    <td>
                        {{ data.job }}
                    </td>
                </tr>
                <tr>
                    <td>学历</td>
                    <td>
                        {{data.xueli}}
                    </td>
                </tr>
                <tr>
                    <td>第一执业医院</td>
                    <td>
                        {{ data.yiyuan }}
                    </td>
                </tr>
                <tr>
                    <td>是否开通账号</td>
                    <td>
                        {{data.zhanghao?"已开通":"未开通"}}
                    </td>
                </tr>
                <tr>
                    <td>类型</td>
                    <td>
                        {{data.type}}
                    </td>
                </tr>
                <tr>
                    <td>创建时间</td>
                    <td>
                        {{data.createdate}}
                    </td>
                </tr>
                <tr>
                    <td>照片</td>
                    <td>
                        <img style="width: 60px; height: 40px;" :src="'https://localhost:7260'+data.img" alt="">
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <input type="button" value="返回" @click="add">
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import axios from 'axios';
import { onMounted, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
const route= useRoute();
const router=useRouter();
const data=ref({
  "id": 0,
  "name": "",
  "kname": "",
  "job": "",
  "xueli": "",
  "img": "",
  "yiyuan": "",
  "type": "",
  "zhanghao": false,
  "createdate": "2025-02-18T09:46:18.051Z",
  "updatedate": "2025-02-18T09:46:18.051Z",
  "del": true
})
const ksdata=ref([{
    "id": 1,
    "name": "外科"
}])
onMounted(()=>{
    show();
    showyss();
})
const show=()=>{
    axios.get('https://localhost:7260/api/YiSheng/GetKeshis').then(res=>{
        ksdata.value=res.data
    })
}
const showyss=()=>{
    var id=route.query.id;
    axios.get('https://localhost:7260/api/YiSheng/GetYiSheng',{params:{id:id}}).then(res=>{
        data.value=res.data;
        data.value.createdate=data.value.createdate.substring(0,10)
    })
}
const add=()=>{
    router.push('/showys');
}
</script>

<style scoped>

</style>